/*
 *===========================================================================
 *
 *          Name: string_test.c
 *        Create: Fri 20 Jul 2012 02:56:05 PM CST
 *
 *   Discription: this is use to remove blank of a string before and after
 *       Version: 1.0.0
 *
 *        Author: yuwei.zhang
 *         Email: yuwei.zhang@besovideo.com
 *
 *===========================================================================
 */

#include <stdio.h>
#include <string.h>

#include "jkglobal.h"

int main(int argc, char **args)
{
    char    tmp1[1024];
    char    tmp2[2048];

    memset(tmp2, 1, sizeof(tmp2));

    JKMSG("cp [%d] \n", strlen(tmp2));
    strncpy(tmp1, tmp2, strlen(tmp2));
    JKMSG("[%d]\n", strlen(tmp1));

    JKMSG("--------------------------\n");
    char    str1[1024];
    char    str2[1024];
    sprintf(str1, "%s", "  123　1    ");

    int i;
    for (i = 0; i < strlen(str1); i++) {
        printf(" x.%02x", str1[i]);
    }
    JKMSG("over\n");

    char   *sp = NULL;
    char    st[24];

    memset(st, 0, sizeof(st));
    sprintf(st, "%s", "test");
    //strncpy(sp, st, strlen(st));
    sp = st;
    JKMSG("down[%s]\n", sp);

    memset(str2, 0, sizeof(str2));
    jk_remove_blank(str1, str2);
    printf("str2 [%s]\n", str2);

    return 0;
}


/*=============== End of file: string_test.c ==========================*/

